package com.sofa.permission.controller;

import com.sofa.api.PermissionService;
import com.sofa.permission.service.PermissionServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class PermissionController implements PermissionService {

    private final PermissionServiceImpl permissionServiceImpl;

    @Override
    public void bindDefaultRole(Long userId) {
        permissionServiceImpl.bindDefaultRole(userId);
    }

    @Override
    public String getUserRoleCode(Long userId) {
        return permissionServiceImpl.getUserRoleCode(userId);
    }

    @Override
    public void upgradeToAdmin(Long userId) {
        permissionServiceImpl.upgradeToAdmin(userId);
    }

    @Override
    public void downgradeToUser(Long userId) {
        permissionServiceImpl.downgradeToUser(userId);
    }
} 